package cs340.stormtroopers.junitTests;

import java.io.IOException;
import java.sql.SQLException;

import cs340.stormtroopers.database.HyPeerWebDatabase;

import junit.framework.TestCase;

// by Andrew Morrow

public class HyPeerWebDatabaseFileSystemTests extends TestCase
{

	protected void tearDown() throws Exception
	{
		super.tearDown();
		HyPeerWebDatabase.getSingleton().close();
	}

	public void testCreatingDatabase()
	{
		try
		{
			HyPeerWebDatabase
					.initHyPeerWebDatabase("db_filesystem_test_cases.sqlite");
			HyPeerWebDatabase db = HyPeerWebDatabase.getSingleton();
			db.clear();
		}
		catch (IOException e)
		{
			fail("IOException: " + e.getMessage());
		}
		catch (ClassNotFoundException e)
		{
			fail("ClassNotFoundException: " + e.getMessage());
		}
		catch (SQLException e)
		{
			fail("SQLException: " + e.getMessage());
		}
	}

	// TODO add more tests
}
